import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:smart_security_box_app/route_config.dart';

import 'logic.dart';

class HomePage extends StatelessWidget {
  final HomeLogic logic = Get.put(HomeLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('密码管理器'),
        actions: _actions(context),
      ),
      body: Container(
        child: Center(
          child: Text('主页面'),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: (){
          Get.toNamed(RouteConfig.passwordGenerator);
        },
        child: Icon(Icons.add),
      ),
    );
  }

  List<Widget> _actions(BuildContext context){
    return [
      IconButton(icon: Icon(Icons.settings), tooltip: '设置', onPressed: (){}),
      IconButton(icon: Icon(Icons.exit_to_app), tooltip: '退出', onPressed: (){}),
    ];
  }
}
